package com.ruoyi.framework.web.service;

import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

/**
 * 继承原来的UserDetailsService新增自定义方法
 * 根据类型查询用户信息
 *
 * @author 10100
 **/
public interface CustomUserDetailsService extends UserDetailsService {

    /**
     * 根据用户类型获取用户信息
     *
     * @param userName 用户名
     * @param userType 用户类型 1 机构 2 企业
     * @return UserDetails
     * @throws UsernameNotFoundException 找不到用户异常
     */
    UserDetails loadUserByUsername(String userName, String userType) throws UsernameNotFoundException;
}